﻿<!-- MVC4WPF
     Copyright © 2009 Information Control Corporation
     Revision History:
     Version 0.9.0.0 First codeplex release  - Stephen Giffin
     -->

<Window
    x:Class="MVC4WPF.Automation.VisualStudio.Dialog.ModelDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mvc4Auto="clr-namespace:MVC4WPF.Automation.Dialog;assembly=MVC4WPF.Automation"
    x:Name="view"
    Title="MVC4WPF" 
    VerticalAlignment="Top" 
    SizeToContent="Height" 
    Width="400" 
    ResizeMode="NoResize" 
    WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="DialogResources.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <mvc4Auto:BooleanToVisibilityValueConverter x:Key="VisibilityConverter"/>
            <DataTemplate x:Key="ContractTemplate">
                <WrapPanel Margin="0">
                    <Image Height="15" Width="15" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="ImageIcon"/>
                    <TextBlock x:Name="TextBlockModel" Margin="5,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Text="{Binding Path=Name}" ToolTip="{Binding Path=FullName}"/>
                </WrapPanel>
            </DataTemplate>
        </ResourceDictionary>
    </Window.Resources>
    <Grid x:Name="LayoutRoot" Background="Black" DataContext="{Binding Path=ViewPropertyBag, ElementName=view, Mode=Default}" VerticalAlignment="Top">
        <DockPanel x:Name="DockPanelDialog" Margin="0" VerticalAlignment="Stretch">
            <Grid DockPanel.Dock="Top" x:Name="GridTitle" Margin="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="50" Background="{DynamicResource ModelBrush}" >
                <TextBlock x:Name="TextBlockDialogTitle" Text="{Binding Path=DialogTitle}" TextAlignment="Left" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" />
                <Image x:Name="ImageDialogTitle" Source="{Binding Path=DialogImage}"  HorizontalAlignment="Right" Width="45" Margin="0,5,5,5"/>
            </Grid>
            <Grid DockPanel.Dock="Bottom" x:Name="GridButtons" Margin="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="50">
                <Path x:Name="PathButtonBreak" Stretch="Fill" Stroke="#FFFFFFFF" Margin="5,5,5,0" VerticalAlignment="Top" Height="1"  Data="M8,8 L376,8">
                    <Path.Fill>
                        <LinearGradientBrush StartPoint="0,0.5" EndPoint="0,0">
                            <GradientStop Color="#FF9600F3" Offset="0"/>
                            <GradientStop Color="#FFA311FF" Offset="1"/>
                            <GradientStop Color="#FFC17AED" Offset="0.9"/>
                        </LinearGradientBrush>
                    </Path.Fill>
                </Path>
                <WrapPanel x:Name="WrapPanelButtons" HorizontalAlignment="Right" VerticalAlignment="Stretch" Margin="0,0,0,-5">
                    <Button x:Name="ButtonSelect" VerticalAlignment="Stretch" MinWidth="60" Content="{Binding Path=SelectName}" Margin="0,15,5,5" Height="25" Click="ButtonSelect_Click" TabIndex="4" IsDefault="True" />
                    <Button x:Name="ButtonCancel" VerticalAlignment="Stretch" Width="60" Content="Cancel" Margin="0,15,5,5" Height="25" Click="ButtonCancel_Click" IsCancel="True" TabIndex="5" />
                </WrapPanel>
            </Grid>
            <Grid DockPanel.Dock="Top" x:Name="GridContent" HorizontalAlignment="Stretch" Margin="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="3*"/>
                    <RowDefinition Height="2*"/>
                </Grid.RowDefinitions>
                <TextBlock x:Name="TextBlockModelTitle" Grid.Row="0" Grid.Column="0" Text="Name:" HorizontalAlignment="Right" VerticalAlignment="Stretch" Margin="5" FontSize="14" Foreground="White"/>
                <TextBlock x:Name="TextBlockName" Text="{Binding Path=ItemName}" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Stretch" Margin="5" FontSize="14" Foreground="White"/>
                <Expander x:Name="ExpanderModelContract" Margin="0" Grid.ColumnSpan="2" Grid.Row="1" IsExpanded="True">
                    <Expander.Header>
                        <TextBlock x:Name="TextBlockModelContractTitle" Text="Model Contract" Foreground="White" Margin="5"/>
                    </Expander.Header>
                    <Grid x:Name="GridContractData">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock x:Name="TextBlockContract"  Grid.Column="0" Text="Name:" HorizontalAlignment="Right" VerticalAlignment="Stretch" Margin="5" FontSize="14" Foreground="White"/>
                        <ComboBox x:Name="ComoboBoxContract" DisplayMemberPath="{Binding Path=Name}" ItemsSource="{Binding Path=AvailableModelContracts}" SelectedItem="{Binding Path=SelectedModelContract}" Grid.Column="1" Margin="5" ItemTemplate="{DynamicResource ContractTemplate}" TabIndex="3"/>
                    </Grid>
                </Expander>
            </Grid>
        </DockPanel>
    </Grid>
</Window>